//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<ILoader.h>
///	@path	~/src/scene/resource/
///	@date	2008/04/13
///	@desc	Loader interface for loading resources.

#pragma once

#include "xeres.h"

#include "object/IObject.h"

#include "database/IData.h"

#include "graphics/IGeometry.h"
#include "graphics/IModel.h"

namespace xeres {

	// forward declaration
	class ResourceLoader;

	/*! 
		\class	ILoader
		\brief	Resource loader interface.
	*/
	class ILoader : public IObject
	{
	public:

		/// \ctor
		ILoader( void );

		/// \dtor
		virtual ~ILoader( void );

		DECL_IOBJECT_INTERFACE( ILoader , IObject );

	public:

		//@ interface
	};

	/*! 
		\class	IVertexLoader
		\brief	'IVertex' Loader.
	*/
	class IVertexLoader : public ILoader
	{
	public:

		/// \ctor
		IVertexLoader( void );

		/// \dtor
		virtual ~IVertexLoader( void );

		DECL_IOBJECT_INTERFACE( IVertexLoader , ILoader );

	public:

		//@ interface
	};

	/*! 
		\class	IGeometryLoader
		\brief	'IGeometry' Loader.
	*/
	class IGeometryLoader : public ILoader
	{
	public:

		/// \ctor
		IGeometryLoader( void );

		/// \dtor
		virtual ~IGeometryLoader( void );

		DECL_IOBJECT_INTERFACE( IGeometryLoader , ILoader );

	public:

		//@ interface

		/// \brief	Loads a geometry.
		virtual RefPass<IGeometry> OnLoad( RefWeak<IData> res , ResourceLoader& loader ) = 0;

	};

	/*! 
		\class	IModelLoader
		\brief	'IModel' Loader.
	*/
	class IModelLoader : public ILoader
	{
	public:

		/// \ctor
		IModelLoader( void );

		/// \dtor
		virtual ~IModelLoader( void );

		DECL_IOBJECT_INTERFACE( IModelLoader , ILoader );

	public:

		//@ interface

		/// \brief	Loads a model.
		virtual RefPass<IModel> OnLoad( RefWeak<IData> res , ResourceLoader& loader ) = 0;
	};

} // namespace xeres
